﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace MagicFight
{
    public class HolySacrifice : Magic
    {
        int HPloss = Def.HolySacrificeDef.HPloss;
        int MPgain = Def.HolySacrificeDef.MPgain;

        public HolySacrifice(Character caster)
            : base(caster, Def.HolySacrificeDef.N) { }

        public override void Effect(GameTime gameTime)
        {
            int a = caster.TakeDamage(HPloss, caster);
            if (a >= 0) ps.effectsManager.Add(new FloatingText(caster.position, a.ToString(), Color.Red));
            a = caster.GainMP(MPgain);
            if (a >= 0) ps.effectsManager.Add(new FloatingText(caster.position, a.ToString(), Color.Blue));
            alive = false;
        }
    }
}
